﻿using System;

namespace LitTools
{
    /// <summary>
    /// 通用引导Item
    /// </summary>
    public class TutorialItem_Common : TutorialItemBase
    {
        public bool showBlackBg;

        public bool showArrow;
        public TutorialArrowInfo[] arrowInfos;

        public bool moveGos;
        public TutorialGameObject[] moveTopGos;

        public PointerFilterInfo pointerFilterInfo;

        public bool showText;
        public TutorialTextInfo textInfo;

        public bool showPop;
        public TutorialPopInfo popInfo;

        public bool showFinger;
        public FingerInfo fingerInfo;

        public Action<string> OnShowAct;
        public Action<string> OnUpdateAct;
        public Action<string> OnHideAct;

        public override void OnShow()
        {
            OnShowAct?.Invoke(id);
        }

        public override void OnUpdate()
        {
            OnUpdateAct?.Invoke(id);
        }

        public override void OnHide()
        {
            OnHideAct?.Invoke(id);
        }
    }

    /// <summary>
    /// 过滤信息
    /// </summary>
    public struct PointerFilterInfo
    {
        public PointerFilterType pointerFilterType;
        public TutorialGameObject[] pointerFilterGos;
        public string[] pointerFilterNames;
    }

    /// <summary>
    /// 箭头信息
    /// </summary>
    public struct TutorialArrowInfo
    {
        public TutorialPosition position;
        public TutorialDir dir;
    }

    /// <summary>
    /// 手指信息
    /// </summary>
    public struct FingerInfo
    {
        public TutorialPosition fingerPos;
        public TutorialDir dir;
    }

    /// <summary>
    /// 文本信息
    /// </summary>
    public struct TutorialTextInfo
    {
        public string text;
        public TutorialPosition position;
        public bool showBtn;
        public string btnText;
        public bool showIcon;
        public string iconPath;
        public bool showTapContinue;
    }

    /// <summary>
    /// 气泡信息
    /// </summary>
    public struct TutorialPopInfo
    {
        public string text;
        public TutorialPosition position;
    }

    /// <summary>
    /// 方向
    /// </summary>
    public enum TutorialDir
    {
        Left,
        Right,
        Up,
        Down,
    }

    /// <summary>
    /// 点击过滤类型
    /// </summary>
    public enum PointerFilterType
    {
        Mask,//遮挡
        AnyWhere,//点击任意位置
        AnyWhere_Pass,//点击任意位置，不拦截事件
        GameObject,//指定物体
        Name,//指定名字
    }
}